import request from '@/utils/request'
import { GET_ARTICLE_LIST } from '@/store/actionTypes'

export const getArticleList = (params = { page: 1, per_page: 10 }) => {
  return async dispatch => {
    const res = await request({ url: '/mp/articles', params })
    console.log(res, params, '111111')
    dispatch({
      type: GET_ARTICLE_LIST,
      payload: res.data
    })
  }
}
export const delArticle = id => {
  return async dispatch => {
    await request({ method: 'delete', url: `/mp/articles/${id}` })
  }
}
